**********************************************************************
*****************Set up command directory for files*******************
**********************************************************************

	clear
	cd "C:\Users\Sean\Dropbox\Eran\Terrorism_Left\Merged_datasets"

**********************************************************************
*****************Clean up Pres Data***********************************
**********************************************************************

*Label vars in pres data and save as .dta

	import excel "terror_pres_wide.xlsx", firstrow
	
		label variable eventid "Act of terror event id"
	label variable year "Act of terror year"
	label variable imonth "Act of terror month"
	label variable iday "Act of terror day"
	
		ren nunber_event_year_nuts2 number_event_year_nuts2
		label variable number_event_year_nuts2 "NUTS id number"
	
	label variable eventid_uniqid "NUTS id number copy"
	label variable eventid_uniqid_3_crit "NUTS id 3 length"
	label variable eventid_3_crit_success "NUTS id 3 length success"
	
	label variable approxdate "Approximate date if precise date not available"
	
	label variable extended "Extended terrorist act binary marker, 1 = yes 0 = no"
	label variable resolution "Date of extended terrorist act conclusion"
	
	label variable country_txt "Str country name"
	label variable country "Country code"
	label variable region_txt "Region code for country"
	label variable provstate "Province or state within a country"
	label variable FIPSCounty "FIPS State County Code"
	
	label variable yearNUTS2 "NUTS2 code string"
	label variable city "City of terrorist act"
	
	label variable latitude "latitude of terrorist act"
	label variable longitude "longitude of terrorist act"
	
	label variable location "Location of terror act"
	label variable summary "Summary of terror act"
	
	label variable crit1 "political, economic, religious or social goal"
	label variable crit2 "intention to coerece, intimidate to larger audiences"
	label variable crit3 "outside international humanitarian law"
	
	label variable doubtterr "doubt terrorism proper? i.e. meets inclusion proper"
	
	label variable alternative "alternative designation"
	label variable alternative_txt "alternative designation as str"
	
	label variable multiple "part of multiple incident"
	
	label variable related "related incidents"
	
	label variable attacktype1 "attack type hierarchy"
	label variable attacktype2 "second attack type, following hierarchy"
	label variable attacktype3 "third attack type, following hierarchy"
	
	label variable success "successful attack category distinction"
	
	label variable suicide "suicide attack, binary 1 = yes 0 = no"
	
	label variable weaptype1 "weapon type, following weapon list"
	label variable weapsubtype1 "weapon subtype, chem, bio, radio, etc."
	
	label variable weaptype2 "second weapon type, following weapon list"
	label variable weapsubtype2 "second weapon subtype, chem, bio, radio, etc."
	
	label variable weaptype3 "third weapon type, following weapon list"
	label variable weapsubtype3 "third weapon subtype, chem, bio, radio, etc."
	
	label variable weaptype4 "fourth weapon type, following weapon list"
	label variable weapsubtype4 "fourth weapon subtype, chem, bio, radio, etc."

	label variable weapdetail "any pertinent information on the type of weapons"

	label variable targtype1 "target/victim type, such as instit. or individuals"
		label variable targsubtype1 "target/victim type subtype, more specific"
		label variable corp1 "name of entity"
		label variable target1 "specific person, building, inst. etc"
		label variable natlty1 "nationality of target/victim"
		
	label variable targtype2 "second target/victim type, such as instit. or individuals"
		label variable targsubtype2 "second target/victim type subtype, more specific"
		label variable corp2 "second name of entity"
		label variable target2 "second specific person, building, inst. etc"
		label variable natlty2 "second nationality of target/victim"
		
	label variable targtype3 "third target/victim type, such as instit. or individuals"
		label variable targsubtype3 "third target/victim type subtype, more specific"
		label variable corp3 "third name of entity"
		label variable target3 "third specific person, building, inst. etc"
		label variable natlty3 "third nationality of target/victim"
		
	label variable gname "perpetrator group name"
	label variable gsubname "perpetrator sub-group name"
	label variable gname2 "second perpetrator group name"
	label variable gsubname2 "second perpetrator sub-group name"
	label variable gname3 "third perpetrator group name"
	label variable gsubname3 "third perpetrator sub-group name"
	
	label variable guncertain1 "first perpetrator group suspected/unconfirmed?"
		label variable guncertain2 "second perpetrator group suspected/unconfirmed?"
		label variable guncertain3 "third perpetrator group suspected/unconfirmed?"

*	label variable independent "unaffiliated ind., whether or not the attack was carried out by ind."
		label variable nperps "number of perpetrators"
		label variable nperpcap "number of perpetrators captued"
		
	label variable claimed "claim of responsibility?"
	label variable claimmode "mode for claim of responsibility"
	
	label variable compclaim "competing claims of responsibility?"
		label variable claim2 "secoind group claim of responsibility?"
		label variable claimmode2 "mode for second group claim of responsibility"
		label variable claim3 "third group claim of responsibility?"
		label variable claimmode3 "mode for third group claim of responsibility"
		
	label variable motive "motive: when reports explicitly mention motive"
	
	label variable motive1 "Is attack hate-based, political, anti-abortion, or of another motivation? Manually coded"
	
	label variable motive2 "What is the specific motivation of the attempted attack? Manually coded"
	
	label var nkill "total number of fatalities"
	
	label var nkillus "number of US fatalities"
	
	label var nkillter "number of perpetrator fatalities"
	
	label var nwound "total number of injured"
	
	label var nwoundus "number of U.S. injured"
	
	label var nwoundte "number of perpetrators injured"
	
	label var property "propery damage binary yes, no, unknown"
	
	label var propextent "extent of property damage"
	
	label var propvalue "value of property damage (in USD)"
	
	label var propcomment "property damage comments"
	
	label var ishostkid "hostages or kidnapping victims binary yes, no, unknown"
	
	label var nhostkid "total number of hostages/kidnapping victims"
	
	label var nhostkidus "number of US hostages/kidnapping victims"
	
	label var nhours "hours of kidnapping / hostage"
	
	label var ndays "days of kidnapping / hostage"
	
	label var divert "country that kidnappers/hijackers diverted to"
	
	label var kidhijcountry "country of kidnapping / hijacking resolution"
	
	label var ransom "ransom demanded"
	
	label var ransomamt "total ransom amount demanded"
	
	label var ransomamtus "ransom amount demanded from US sources"
	
	label var ransompaid "total ransom amount paid"
	
	label var ransompaidus "ransom amount paid by US sources"
	
	label var ransomnote "ransom notes - specific details, etc"
	
	label var hostkidoutcome "kidnapping/hostage outcome category"
	
	label var nreleased "number releated/escaped/rescued"
	
	label var addnotes "additional notes for event"
	
	label var INT_LOG "international-logistical binary variable"
	
	label var INT_IDEO "international-ideological binary variable"
	
	label var INT_ANY "international - any of the above"
	
	label var TotalVote_t1 "vote raw total, before attack"
	ren dem_vote_t1 dem_rank_t1
	ren rep_vote_t1 rep_rank_t1
	ren other_vote_t1 other_rank_t1
	label var dem_rank_t1  "dem rank, before attack"
	label var rep_rank_t1 "rep rank, before attack"
	label var other_rank_t1 "other rank, before attack"
    label var Margin_t1 "raw margin, before attack"
    label var H_t1 "margin pct, before attack"
	label var dem_perc_vote_t1 "dem pct vote, before attack"
	label var rep_perc_vote_t1 "rep pct vote, before attack"
	label var third_perc_vote_t1 "third pct vote, before attack"
	label var other_perc_vote_t1 "other pct vote, before attack"
	label var dem_raw_vote_t1 "dem raw vote, before attack"
	label var rep_raw_vote_t1 "rep raw vote, before attack"
	label var other_raw_vote_t1 "other raw vote, before attack"
	
	label var TotalVote_t2 "vote raw total, after attack"
	ren dem_vote_t2 dem_rank_t2
	ren rep_vote_t2 rep_rank_t2
	ren other_vote_t2 other_rank_t2
	label var dem_rank_t2  "dem rank, before attack"
	label var rep_rank_t2 "rep rank, before attack"
	label var other_rank_t2 "other rank, before attack"
    label var Margin_t2 "raw margin, after attack"
    label var H_t2 "margin pct, after attack"
	label var dem_perc_vote_t2 "dem pct vote, after attack"
	label var rep_perc_vote_t2 "rep pct vote, after attack"
	label var third_perc_vote_t2 "third pct vote, after attack"
	label var other_perc_vote_t2 "other pct vote, after attack"
	label var dem_raw_vote_t2 "dem raw vote, after attack"
	label var rep_raw_vote_t2 "rep raw vote, after attack"
	label var other_raw_vote_t2 "other raw vote, after attack"
	*label var rep_margin_t1 "margin of republican win or loss, before"
	*label var rep_margin_t2 "margin of republican win or loss, after"
	*label var rep_marg_change "difference in republican margin of win or loss"
	
	label var event_to_t2 "days from attack to next election"
	label var t1_to_event "days from previous election to attack"
	
	save "terror_pres_wide.dta", replace
	
	clear
	
**********************************************************************
*****************Clean up House Data**********************************
**********************************************************************
	*Label vars in house data and save as .dta

	import excel "terror_house_wide.xlsx", firstrow
	
		label variable eventid "Act of terror event id"
	label variable year "Act of terror year"
	label variable imonth "Act of terror month"
	label variable iday "Act of terror day"
	
		ren nunber_event_year_nuts2 number_event_year_nuts2
		label variable number_event_year_nuts2 "NUTS id number"
	
	label variable eventid_uniqid "NUTS id number copy"
	label variable eventid_uniqid_3_crit "NUTS id 3 length"
	label variable eventid_3_crit_success "NUTS id 3 length success"
	
	label variable approxdate "Approximate date if precise date not available"
	
	label variable extended "Extended terrorist act binary marker, 1 = yes 0 = no"
	label variable resolution "Date of extended terrorist act conclusion"
	
	label variable country_txt "Str country name"
	label variable country "Country code"
	label variable region_txt "Region code for country"
	label variable provstate "Province or state within a country"
	label variable FIPSCounty "FIPS State County Code"
	
	label variable yearNUTS2 "NUTS2 code string"
	label variable city "City of terrorist act"
	
	label variable latitude "latitude of terrorist act"
	label variable longitude "longitude of terrorist act"
	
	label variable location "Location of terror act"
	label variable summary "Summary of terror act"
	
	label variable crit1 "political, economic, religious or social goal"
	label variable crit2 "intention to coerece, intimidate to larger audiences"
	label variable crit3 "outside international humanitarian law"
	
	label variable doubtterr "doubt terrorism proper? i.e. meets inclusion proper"
	
	label variable alternative "alternative designation"
	label variable alternative_txt "alternative designation as str"
	
	label variable multiple "part of multiple incident"
	
	label variable related "related incidents"
	
	label variable attacktype1 "attack type hierarchy"
	label variable attacktype2 "second attack type, following hierarchy"
	label variable attacktype3 "third attack type, following hierarchy"
	
	label variable success "successful attack category distinction"
	
	label variable suicide "suicide attack, binary 1 = yes 0 = no"
	
	label variable weaptype1 "weapon type, following weapon list"
	label variable weapsubtype1 "weapon subtype, chem, bio, radio, etc."
	
	label variable weaptype2 "second weapon type, following weapon list"
	label variable weapsubtype2 "second weapon subtype, chem, bio, radio, etc."
	
	label variable weaptype3 "third weapon type, following weapon list"
	label variable weapsubtype3 "third weapon subtype, chem, bio, radio, etc."
	
	label variable weaptype4 "fourth weapon type, following weapon list"
	label variable weapsubtype4 "fourth weapon subtype, chem, bio, radio, etc."

	label variable weapdetail "any pertinent information on the type of weapons"

	label variable targtype1 "target/victim type, such as instit. or individuals"
		label variable targsubtype1 "target/victim type subtype, more specific"
		label variable corp1 "name of entity"
		label variable target1 "specific person, building, inst. etc"
		label variable natlty1 "nationality of target/victim"
		
	label variable targtype2 "second target/victim type, such as instit. or individuals"
		label variable targsubtype2 "second target/victim type subtype, more specific"
		label variable corp2 "second name of entity"
		label variable target2 "second specific person, building, inst. etc"
		label variable natlty2 "second nationality of target/victim"
		
	label variable targtype3 "third target/victim type, such as instit. or individuals"
		label variable targsubtype3 "third target/victim type subtype, more specific"
		label variable corp3 "third name of entity"
		label variable target3 "third specific person, building, inst. etc"
		label variable natlty3 "third nationality of target/victim"
		
	label variable gname "perpetrator group name"
	label variable gsubname "perpetrator sub-group name"
	label variable gname2 "second perpetrator group name"
	label variable gsubname2 "second perpetrator sub-group name"
	label variable gname3 "third perpetrator group name"
	label variable gsubname3 "third perpetrator sub-group name"
	
	label variable guncertain1 "first perpetrator group suspected/unconfirmed?"
		label variable guncertain2 "second perpetrator group suspected/unconfirmed?"
		label variable guncertain3 "third perpetrator group suspected/unconfirmed?"

*	label variable independent "unaffiliated ind., whether or not the attack was carried out by ind."
		label variable nperps "number of perpetrators"
		label variable nperpcap "number of perpetrators captued"
		
	label variable claimed "claim of responsibility?"
	label variable claimmode "mode for claim of responsibility"
	
	label variable compclaim "competing claims of responsibility?"
		label variable claim2 "secoind group claim of responsibility?"
		label variable claimmode2 "mode for second group claim of responsibility"
		label variable claim3 "third group claim of responsibility?"
		label variable claimmode3 "mode for third group claim of responsibility"
		
	label variable motive "motive: when reports explicitly mention motive"
	
	label variable motive1 "Is attack hate-based, political, anti-abortion, or of another motivation? Manually coded"
	
	label variable motive2 "What is the specific motivation of the attempted attack? Manually coded"
	
	label var nkill "total number of fatalities"
	
	label var nkillus "number of US fatalities"
	
	label var nkillter "number of perpetrator fatalities"
	
	label var nwound "total number of injured"
	
	label var nwoundus "number of U.S. injured"
	
	label var nwoundte "number of perpetrators injured"
	
	label var property "propery damage binary yes, no, unknown"
	
	label var propextent "extent of property damage"
	
	label var propvalue "value of property damage (in USD)"
	
	label var propcomment "property damage comments"
	
	label var ishostkid "hostages or kidnapping victims binary yes, no, unknown"
	
	label var nhostkid "total number of hostages/kidnapping victims"
	
	label var nhostkidus "number of US hostages/kidnapping victims"
	
	label var nhours "hours of kidnapping / hostage"
	
	label var ndays "days of kidnapping / hostage"
	
	label var divert "country that kidnappers/hijackers diverted to"
	
	label var kidhijcountry "country of kidnapping / hijacking resolution"
	
	label var ransom "ransom demanded"
	
	label var ransomamt "total ransom amount demanded"
	
	label var ransomamtus "ransom amount demanded from US sources"
	
	label var ransompaid "total ransom amount paid"
	
	label var ransompaidus "ransom amount paid by US sources"
	
	label var ransomnote "ransom notes - specific details, etc"
	
	label var hostkidoutcome "kidnapping/hostage outcome category"
	
	label var nreleased "number releated/escaped/rescued"
	
	label var addnotes "additional notes for event"
	
	label var INT_LOG "international-logistical binary variable"
	
	label var INT_IDEO "international-ideological binary variable"
	
	label var INT_ANY "international - any of the above"
	
	label var county_name_t1 "Electoral County Name, before attack"
    label var totalvote_t1 "vote raw total, before attack"
	ren demo_elecvote_h_t1 dem_rank_t1
	label var dem_rank_t1 "dem candidate rank, before attack"
	ren repub_elecvotes_h_t1 rep_rank_t1
	label var rep_rank_t1 "rep candidate rank, before attack"
	ren ind_elecvotes_h_t1 ind_rank_t1
	label var ind_rank_t1 "independent candidate rank, before attack"
	label var margin_t1 "raw margin, before attack"
	ren margin_pct_h_t1 perc_margin_t1
	label var perc_margin_t1 "margin pct, before attack"
	ren demo_pct_h_t1 dem_perc_t1
	label var dem_perc_t1 "demo pct vote, before attack"
	ren repub_pct_h_t1 rep_perc_t1
	label var rep_perc_t1 "rep pct vote, before attack"
	ren ind_pct_h_t1 ind_perc_t1
	label var ind_perc_t1 "ind pct vote, before attack"
	ren other_pct_h_t1 other_perc_t1
	label var other_perc_t1 "other pct vote, before attack"
	label var cd_t1 "Congressional District, before attack"
	
	label var county_name_t2 "Electoral County Name, after attack"
    label var totalvote_t2 "vote raw total, after attack"
    ren demo_elecvote_h_t2 dem_rank_t2
	label var dem_rank_t2 "dem candidate rank, before attack"
	ren repub_elecvotes_h_t2 rep_rank_t2
	label var rep_rank_t2 "rep candidate rank, before attack"
	ren ind_elecvotes_h_t2 ind_rank_t2
	label var ind_rank_t2 "independent candidate rank, before attack"
	label var margin_t2 "raw margin, before attack"
	ren margin_pct_h_t2 perc_margin_t2
	label var perc_margin_t2 "margin pct, before attack"
	ren demo_pct_h_t2 dem_perc_t2
	label var dem_perc_t2 "demo pct vote, before attack"
	ren repub_pct_h_t2 rep_perc_t2
	label var rep_perc_t2 "rep pct vote, before attack"
	ren ind_pct_h_t2 ind_perc_t2
	label var ind_perc_t2 "ind pct vote, before attack"
	ren other_pct_h_t2 other_perc_t2
	label var other_perc_t2 "other pct vote, before attack"
	label var cd_t2 "Congressional District, after attack"
	
	
	label var event_to_t2 "days from attack to next election"
	label var t1_to_event "days from previous election to attack"
	
	save "terror_house_wide.dta", replace
	
	clear
	
**********************************************************************
*****************Clean up Senate Data*********************************
**********************************************************************
*Label vars in senate data and save as .dta

		import excel "terror_senate_wide.xlsx", firstrow
	
		label variable eventid "Act of terror event id"
	label variable year "Act of terror year"
	label variable imonth "Act of terror month"
	label variable iday "Act of terror day"
	
		ren nunber_event_year_nuts2 number_event_year_nuts2
		label variable number_event_year_nuts2 "NUTS id number"
	
	label variable eventid_uniqid "NUTS id number copy"
	label variable eventid_uniqid_3_crit "NUTS id 3 length"
	label variable eventid_3_crit_success "NUTS id 3 length success"
	
	label variable approxdate "Approximate date if precise date not available"
	
	label variable extended "Extended terrorist act binary marker, 1 = yes 0 = no"
	label variable resolution "Date of extended terrorist act conclusion"
	
	label variable country_txt "Str country name"
	label variable country "Country code"
	label variable region_txt "Region code for country"
	label variable provstate "Province or state within a country"
	label variable FIPSCounty "FIPS State County Code"
	
	label variable yearNUTS2 "NUTS2 code string"
	label variable city "City of terrorist act"
	
	label variable latitude "latitude of terrorist act"
	label variable longitude "longitude of terrorist act"
	
	label variable location "Location of terror act"
	label variable summary "Summary of terror act"
	
	label variable crit1 "political, economic, religious or social goal"
	label variable crit2 "intention to coerece, intimidate to larger audiences"
	label variable crit3 "outside international humanitarian law"
	
	label variable doubtterr "doubt terrorism proper? i.e. meets inclusion proper"
	
	label variable alternative "alternative designation"
	label variable alternative_txt "alternative designation as str"
	
	label variable multiple "part of multiple incident"
	
	label variable related "related incidents"
	
	label variable attacktype1 "attack type hierarchy"
	label variable attacktype2 "second attack type, following hierarchy"
	label variable attacktype3 "third attack type, following hierarchy"
	
	label variable success "successful attack category distinction"
	
	label variable suicide "suicide attack, binary 1 = yes 0 = no"
	
	label variable weaptype1 "weapon type, following weapon list"
	label variable weapsubtype1 "weapon subtype, chem, bio, radio, etc."
	
	label variable weaptype2 "second weapon type, following weapon list"
	label variable weapsubtype2 "second weapon subtype, chem, bio, radio, etc."
	
	label variable weaptype3 "third weapon type, following weapon list"
	label variable weapsubtype3 "third weapon subtype, chem, bio, radio, etc."
	
	label variable weaptype4 "fourth weapon type, following weapon list"
	label variable weapsubtype4 "fourth weapon subtype, chem, bio, radio, etc."

	label variable weapdetail "any pertinent information on the type of weapons"

	label variable targtype1 "target/victim type, such as instit. or individuals"
		label variable targsubtype1 "target/victim type subtype, more specific"
		label variable corp1 "name of entity"
		label variable target1 "specific person, building, inst. etc"
		label variable natlty1 "nationality of target/victim"
		
	label variable targtype2 "second target/victim type, such as instit. or individuals"
		label variable targsubtype2 "second target/victim type subtype, more specific"
		label variable corp2 "second name of entity"
		label variable target2 "second specific person, building, inst. etc"
		label variable natlty2 "second nationality of target/victim"
		
	label variable targtype3 "third target/victim type, such as instit. or individuals"
		label variable targsubtype3 "third target/victim type subtype, more specific"
		label variable corp3 "third name of entity"
		label variable target3 "third specific person, building, inst. etc"
		label variable natlty3 "third nationality of target/victim"
		
	label variable gname "perpetrator group name"
	label variable gsubname "perpetrator sub-group name"
	label variable gname2 "second perpetrator group name"
	label variable gsubname2 "second perpetrator sub-group name"
	label variable gname3 "third perpetrator group name"
	label variable gsubname3 "third perpetrator sub-group name"
	
	label variable guncertain1 "first perpetrator group suspected/unconfirmed?"
		label variable guncertain2 "second perpetrator group suspected/unconfirmed?"
		label variable guncertain3 "third perpetrator group suspected/unconfirmed?"

*	label variable independent "unaffiliated ind., whether or not the attack was carried out by ind."
		label variable nperps "number of perpetrators"
		label variable nperpcap "number of perpetrators captued"
		
	label variable claimed "claim of responsibility?"
	label variable claimmode "mode for claim of responsibility"
	
	label variable compclaim "competing claims of responsibility?"
		label variable claim2 "secoind group claim of responsibility?"
		label variable claimmode2 "mode for second group claim of responsibility"
		label variable claim3 "third group claim of responsibility?"
		label variable claimmode3 "mode for third group claim of responsibility"
		
	label variable motive "motive: when reports explicitly mention motive"
	
	label variable motive1 "Is attack hate-based, political, anti-abortion, or of another motivation? Manually coded"
	
	label variable motive2 "What is the specific motivation of the attempted attack? Manually coded"
	
	label var nkill "total number of fatalities"
	
	label var nkillus "number of US fatalities"
	
	label var nkillter "number of perpetrator fatalities"
	
	label var nwound "total number of injured"
	
	label var nwoundus "number of U.S. injured"
	
	label var nwoundte "number of perpetrators injured"
	
	label var property "propery damage binary yes, no, unknown"
	
	label var propextent "extent of property damage"
	
	label var propvalue "value of property damage (in USD)"
	
	label var propcomment "property damage comments"
	
	label var ishostkid "hostages or kidnapping victims binary yes, no, unknown"
	
	label var nhostkid "total number of hostages/kidnapping victims"
	
	label var nhostkidus "number of US hostages/kidnapping victims"
	
	label var nhours "hours of kidnapping / hostage"
	
	label var ndays "days of kidnapping / hostage"
	
	label var divert "country that kidnappers/hijackers diverted to"
	
	label var kidhijcountry "country of kidnapping / hijacking resolution"
	
	label var ransom "ransom demanded"
	
	label var ransomamt "total ransom amount demanded"
	
	label var ransomamtus "ransom amount demanded from US sources"
	
	label var ransompaid "total ransom amount paid"
	
	label var ransompaidus "ransom amount paid by US sources"
	
	label var ransomnote "ransom notes - specific details, etc"
	
	label var hostkidoutcome "kidnapping/hostage outcome category"
	
	label var nreleased "number releated/escaped/rescued"
	
	label var addnotes "additional notes for event"
	
	label var INT_LOG "international-logistical binary variable"
	
	label var INT_IDEO "international-ideological binary variable"
	
	label var INT_ANY "international - any of the above"
	
	label var county_name_t1 "Electoral County Name, before attack"
    label var totalvote_t1 "vote raw total, before attack"
	ren demo_elecvote_s_t1 dem_rank_t1
	label var dem_rank_t1 "dem candidate rank, before attack"
	ren repub_elecvotes_s_t1 rep_rank_t1
	label var rep_rank_t1 "rep candidate rank, before attack"
	ren ind_elecvotes_s_t1 ind_rank_t1
	label var ind_rank_t1 "independent candidate rank, before attack"
	label var margin_t1 "raw margin, before attack"
	ren margin_pct_s_t1 perc_margin_t1
	label var perc_margin_t1 "margin pct, before attack"
	ren demo_pct_s_t1 dem_perc_t1
	label var dem_perc_t1 "demo pct vote, before attack"
	ren repub_pct_s_t1 rep_perc_t1
	label var rep_perc_t1 "rep pct vote, before attack"
	ren ind_pct_s_t1 ind_perc_t1
	label var ind_perc_t1 "ind pct vote, before attack"
	ren other_pct_s_t1 other_perc_t1
	label var other_perc_t1 "other pct vote, before attack"
	
	label var county_name_t2 "Electoral County Name, after attack"
    label var totalvote_t2 "vote raw total, after attack"
    ren demo_elecvote_s_t2 dem_rank_t2
	label var dem_rank_t2 "dem candidate rank, before attack"
	ren repub_elecvotes_s_t2 rep_rank_t2
	label var rep_rank_t2 "rep candidate rank, before attack"
	ren ind_elecvotes_s_t2 ind_rank_t2
	label var ind_rank_t2 "independent candidate rank, before attack"
	label var margin_t2 "raw margin, before attack"
	ren margin_pct_s_t2 perc_margin_t2
	label var perc_margin_t2 "margin pct, before attack"
	ren demo_pct_s_t2 dem_perc_t2
	label var dem_perc_t2 "demo pct vote, before attack"
	ren repub_pct_s_t2 rep_perc_t2
	label var rep_perc_t2 "rep pct vote, before attack"
	ren ind_pct_s_t2 ind_perc_t2
	label var ind_perc_t2 "ind pct vote, before attack"
	ren other_pct_s_t2 other_perc_t2
	label var other_perc_t2 "other pct vote, before attack"
	
	
	label var event_to_t2 "days from attack to next election"
	label var t1_to_event "days from previous election to attack"
	
	save "terror_senate_wide.dta", replace 
	
	clear

**********************************************************************
*****************Clean up Gubernatorial Data**************************
**********************************************************************

*Label vars in gub data and save as .dta

	import excel "terror_gub_wide.xlsx", firstrow
	
		label variable eventid "Act of terror event id"
	label variable year "Act of terror year"
	label variable imonth "Act of terror month"
	label variable iday "Act of terror day"
	
		ren nunber_event_year_nuts2 number_event_year_nuts2
		label variable number_event_year_nuts2 "NUTS id number"
	
	label variable eventid_uniqid "NUTS id number copy"
	label variable eventid_uniqid_3_crit "NUTS id 3 length"
	label variable eventid_3_crit_success "NUTS id 3 length success"
	
	label variable approxdate "Approximate date if precise date not available"
	
	label variable extended "Extended terrorist act binary marker, 1 = yes 0 = no"
	label variable resolution "Date of extended terrorist act conclusion"
	
	label variable country_txt "Str country name"
	label variable country "Country code"
	label variable region_txt "Region code for country"
	label variable provstate "Province or state within a country"
	label variable FIPSCounty "FIPS State County Code"
	
	label variable yearNUTS2 "NUTS2 code string"
	label variable city "City of terrorist act"
	
	label variable latitude "latitude of terrorist act"
	label variable longitude "longitude of terrorist act"
	
	label variable location "Location of terror act"
	label variable summary "Summary of terror act"
	
	label variable crit1 "political, economic, religious or social goal"
	label variable crit2 "intention to coerece, intimidate to larger audiences"
	label variable crit3 "outside international humanitarian law"
	
	label variable doubtterr "doubt terrorism proper? i.e. meets inclusion proper"
	
	label variable alternative "alternative designation"
	label variable alternative_txt "alternative designation as str"
	
	label variable multiple "part of multiple incident"
	
	label variable related "related incidents"
	
	label variable attacktype1 "attack type hierarchy"
	label variable attacktype2 "second attack type, following hierarchy"
	label variable attacktype3 "third attack type, following hierarchy"
	
	label variable success "successful attack category distinction"
	
	label variable suicide "suicide attack, binary 1 = yes 0 = no"
	
	label variable weaptype1 "weapon type, following weapon list"
	label variable weapsubtype1 "weapon subtype, chem, bio, radio, etc."
	
	label variable weaptype2 "second weapon type, following weapon list"
	label variable weapsubtype2 "second weapon subtype, chem, bio, radio, etc."
	
	label variable weaptype3 "third weapon type, following weapon list"
	label variable weapsubtype3 "third weapon subtype, chem, bio, radio, etc."
	
	label variable weaptype4 "fourth weapon type, following weapon list"
	label variable weapsubtype4 "fourth weapon subtype, chem, bio, radio, etc."

	label variable weapdetail "any pertinent information on the type of weapons"

	label variable targtype1 "target/victim type, such as instit. or individuals"
		label variable targsubtype1 "target/victim type subtype, more specific"
		label variable corp1 "name of entity"
		label variable target1 "specific person, building, inst. etc"
		label variable natlty1 "nationality of target/victim"
		
	label variable targtype2 "second target/victim type, such as instit. or individuals"
		label variable targsubtype2 "second target/victim type subtype, more specific"
		label variable corp2 "second name of entity"
		label variable target2 "second specific person, building, inst. etc"
		label variable natlty2 "second nationality of target/victim"
		
	label variable targtype3 "third target/victim type, such as instit. or individuals"
		label variable targsubtype3 "third target/victim type subtype, more specific"
		label variable corp3 "third name of entity"
		label variable target3 "third specific person, building, inst. etc"
		label variable natlty3 "third nationality of target/victim"
		
	label variable gname "perpetrator group name"
	label variable gsubname "perpetrator sub-group name"
	label variable gname2 "second perpetrator group name"
	label variable gsubname2 "second perpetrator sub-group name"
	label variable gname3 "third perpetrator group name"
	label variable gsubname3 "third perpetrator sub-group name"
	
	label variable guncertain1 "first perpetrator group suspected/unconfirmed?"
		label variable guncertain2 "second perpetrator group suspected/unconfirmed?"
		label variable guncertain3 "third perpetrator group suspected/unconfirmed?"

*	label variable independent "unaffiliated ind., whether or not the attack was carried out by ind."
		label variable nperps "number of perpetrators"
		label variable nperpcap "number of perpetrators captued"
		
	label variable claimed "claim of responsibility?"
	label variable claimmode "mode for claim of responsibility"
	
	label variable compclaim "competing claims of responsibility?"
		label variable claim2 "secoind group claim of responsibility?"
		label variable claimmode2 "mode for second group claim of responsibility"
		label variable claim3 "third group claim of responsibility?"
		label variable claimmode3 "mode for third group claim of responsibility"
		
	label variable motive "motive: when reports explicitly mention motive"
	
	label variable motive1 "Is attack hate-based, political, anti-abortion, or of another motivation? Manually coded"
	
	label variable motive2 "What is the specific motivation of the attempted attack? Manually coded"
	
	label var nkill "total number of fatalities"
	
	label var nkillus "number of US fatalities"
	
	label var nkillter "number of perpetrator fatalities"
	
	label var nwound "total number of injured"
	
	label var nwoundus "number of U.S. injured"
	
	label var nwoundte "number of perpetrators injured"
	
	label var property "propery damage binary yes, no, unknown"
	
	label var propextent "extent of property damage"
	
	label var propvalue "value of property damage (in USD)"
	
	label var propcomment "property damage comments"
	
	label var ishostkid "hostages or kidnapping victims binary yes, no, unknown"
	
	label var nhostkid "total number of hostages/kidnapping victims"
	
	label var nhostkidus "number of US hostages/kidnapping victims"
	
	label var nhours "hours of kidnapping / hostage"
	
	label var ndays "days of kidnapping / hostage"
	
	label var divert "country that kidnappers/hijackers diverted to"
	
	label var kidhijcountry "country of kidnapping / hijacking resolution"
	
	label var ransom "ransom demanded"
	
	label var ransomamt "total ransom amount demanded"
	
	label var ransomamtus "ransom amount demanded from US sources"
	
	label var ransompaid "total ransom amount paid"
	
	label var ransompaidus "ransom amount paid by US sources"
	
	label var ransomnote "ransom notes - specific details, etc"
	
	label var hostkidoutcome "kidnapping/hostage outcome category"
	
	label var nreleased "number releated/escaped/rescued"
	
	label var addnotes "additional notes for event"
	
	label var INT_LOG "international-logistical binary variable"
	
	label var INT_IDEO "international-ideological binary variable"
	
	label var INT_ANY "international - any of the above"
	
	label var year_t1 "year of election before attack"
	label var incumbent_demo_t1 "Incumbent was a Democrat during election before attack"
	label var pct_demo_t1 "percentage vote for democrat, election before attack"
	label var pct_repu_t1 "percentage vote for repub, election before attack"
	label var pct_other_t1 "percentage vote for other, election before attack"
	label var election_date_t1 "date of election, election before attack"
	
	label var year_t2 "year of election after attack"
	label var incumbent_demo_t2 "Incumbent was a Democrat during election after attack"
	label var pct_demo_t2 "percentage vote for democrat, election after attack"
	label var pct_repu_t2 "percentage vote for repub, election after attack"
	label var pct_other_t2 "percentage vote for other, election after attack"
	label var election_date_t2 "date of election, election after attack"
	
	label var event_to_t2 "days from attack to next election"
	label var t1_to_event "days from previous election to attack"
	
	save "terror_gub_wide.dta", replace
	
	clear
	
**********************************************************************
*****************Clean up county election-year pres data**************
**********************************************************************

*Label vars in pres data and save as .dta

	use "pres_all_terror.dta"
	
	label var state_fips "State FIPS Code"
	label var county_fips "county FIPS Code"
	label var election_year "Year of Election"
	label var totalvote "Total Raw Vote"
	label var dem_rank "rank of dem candidate"
	label var rep_rank "rank of republican candidate"
	label var other_rank "rank of other candidate"
	label var margin "Raw margin of victory"
	label var perc_margin "Percentage margin of victory"
	label var dem_perc_vote "Percentage vote democrat"
	label var rep_perc_vote "Percentage vote republican"
	label var third_perc_vote "Percentage vote third party"
	label var other_perc_vote "Percentage vote other"
	label var dem_raw_vote "Raw vote for dem candidate"
	label var rep_raw_vote "Raw vote for rep candidate"
	label var other_raw_vote "Raw vote for other candidate"
	label var attack_count "total attacks in this period"
	label var days_till_election_avg             "average days till election of attacks"
	label var days_till_election_last            "days till election of the last attack"
	label var abortion_count                     "number of abortion motive attacks"
	label var hatred_count                       "number of hatred motive attacks"	
	label var political_count                    "number of political motive attacks"
	label var unknown_count                      "number of unknown motive attacks"
	label var success_count                      "number of successful attacks"
	label var vicinity_count                     "number of attacks in the vicinity of the coded city"
	label var assassination_count                "number of assassination type attacks"
	label var armed_count                        "number of armed type attacks"
	label var bomb_count                         "number of bomb type attacks"
	label var hijack_count                       "number of hijacking type attacks"
	label var hostage_count                      "number of hostage type attacks"	
	label var kidnap_count                       "number of kidnapping type attacks"
	label var facility_count                     "number of facility type attacks"
	label var unarmed_count                      "number of unarmed type attacks"
	label var unknown_type_count                 "number of unknown type attacks"
	label var suicide_count                      "number of suicide attacks"
	label var nperps_avg                         "average number of perpetrators"
	label var nperps_tot                         "total number of perpetrators"
	label var claimed_count                      "number of claimed attacks"
	label var nkill_avg                          "average number killed"
	label var nkill_tot                          "total number killed"
	label var nkillter_avg                       "average terrorists killed"
	label var nkillter_tot                       "total terrorists killed"
	label var nwound_avg                         "average number wounded"
	label var nwound_tot                         "total number wounded"
	label var nwoundter_avg                      "average terrorists wounded"	
	label var nwoundter_tot                      "total terrorists wounded"
	label var property_count                     "number property damaged"
	label var propvalue_avg                      "average property damaged"
	label var propvalue_tot                      "total value of property damaged"
	label var international_logistics_count      "number attacks with intl logistics"
	label var abortion_targ_count                "number abortion target"
	label var air_targ_count                     "number air target"
	label var business_targ_count                "number business target"
	label var education_targ_count               "number education target"
	label var foodwater_targ_count               "number food/water target"
	label var diplo_targ_count                   "number gov diplomacy target"
	label var gov_targ_count                     "number general gov target"
	label var media_targ_count                   "number media/journalist target"
	label var maritime_targ_count                "number maritime target"
	label var military_targ_count                "number military target"
	label var ngo_targ_count                     "number ngo target"
	label var other_targ_count                   "number other target"
	label var police_targ_count                  "number police target"
	label var private_targ_count                 "number private person/property target"
	label var relig_targ_count                   "number religious target"
	label var telecom_targ_count                 "number telecom target"
	label var nonstate_actor_targ_count          "number NSA/terrorist org target"
	label var tourist_targ_count                 "number tourist target"
	label var transport_targ_count               "number transport target"
	label var unknown_targ_count                 "number unknown target"
	label var utilities_targ_count               "number utilities target"
	*label var violent_political_party_targ_count "number violent political party target"
	label var NA_targ_count                      "NA target count"
	label var biological_weap_count              "number biological weapon attack"
	label var chemical_weap_count                "number chemical weapon attack"
	label var explosives_weap_count              "number explosive weapon attack"
	label var fake_weap_count                    "number fake weapon attack"
	label var firearms_weap_count                "number firearm attack"
	label var incendiary_weap_count              "number incendiary attack"
	label var melee_weap_count                   "number melee weapon attack"
	label var other_weap_count                   "number other weapon attack"
	label var radiological_weap_count            "number radiological weapon attack"
	label var sabotage_weap_count                "number sabotage weapon attack"
	label var unknown_weap_count                 "number unknown weapon attack"
	label var vehicle_weap_count                 "number vehicle weapon (not car bomb) attack"
	label var NA_weap_count                      "number NA weapon"
	
	save "pres_all_terror.dta", replace 
	
	clear
	
**********************************************************************
*****************Clean up county election-year senate data************
**********************************************************************

*Label vars in senate data and save as .dta

	use "senate_all_terror.dta"
	
	label var state_fips "State FIPS Code"
	label var county_fips "county FIPS Code"
	label var election_year "Year of Election"
	label var fips "total fips code"
	label var totalvote "Total Raw Vote"
	label var dem_rank "rank of dem candidate"
	label var rep_rank "rank of republican candidate"
	label var ind_rank "rank of independent candidate"
	label var margin "Raw margin of victory"
	label var perc_margin "Percentage margin of victory"
	label var dem_perc_vote "Percentage vote democrat"
	label var rep_perc_vote "Percentage vote republican"
	label var ind_perc_vote "Percentage vote third party"
	ren other_pct_s other_perc_vote
	label var other_perc_vote "Percentage vote other"
	label var dem_raw_vote "Raw vote for dem candidate"
	label var rep_raw_vote "Raw vote for rep candidate"
	label var attack_count "total attacks in this period"
	label var days_till_election_avg             "average days till election of attacks"
	label var days_till_election_last            "days till election of the last attack"
	label var abortion_count                     "number of abortion motive attacks"
	label var hatred_count                       "number of hatred motive attacks"	
	label var political_count                    "number of political motive attacks"
	label var unknown_count                      "number of unknown motive attacks"
	label var success_count                      "number of successful attacks"
	label var vicinity_count                     "number of attacks in the vicinity of the coded city"
	label var assassination_count                "number of assassination type attacks"
	label var armed_count                        "number of armed type attacks"
	label var bomb_count                         "number of bomb type attacks"
	label var hijack_count                       "number of hijacking type attacks"
	label var hostage_count                      "number of hostage type attacks"	
	label var kidnap_count                       "number of kidnapping type attacks"
	label var facility_count                     "number of facility type attacks"
	label var unarmed_count                      "number of unarmed type attacks"
	label var unknown_type_count                 "number of unknown type attacks"
	label var suicide_count                      "number of suicide attacks"
	label var nperps_avg                         "average number of perpetrators"
	label var nperps_tot                         "total number of perpetrators"
	label var claimed_count                      "number of claimed attacks"
	label var nkill_avg                          "average number killed"
	label var nkill_tot                          "total number killed"
	label var nkillter_avg                       "average terrorists killed"
	label var nkillter_tot                       "total terrorists killed"
	label var nwound_avg                         "average number wounded"
	label var nwound_tot                         "total number wounded"
	label var nwoundter_avg                      "average terrorists wounded"	
	label var nwoundter_tot                      "total terrorists wounded"
	label var property_count                     "number property damaged"
	label var propvalue_avg                      "average property damaged"
	label var propvalue_tot                      "total value of property damaged"
	label var international_logistics_count      "number attacks with intl logistics"
	label var abortion_targ_count                "number abortion target"
	label var air_targ_count                     "number air target"
	label var business_targ_count                "number business target"
	label var education_targ_count               "number education target"
	label var diplo_targ_count                   "number gov diplomacy target"
	label var gov_targ_count                     "number general gov target"
	label var media_targ_count                   "number media/journalist target"
	label var maritime_targ_count                "number maritime target"
	label var military_targ_count                "number military target"
	label var ngo_targ_count                     "number ngo target"
	label var police_targ_count                  "number police target"
	label var private_targ_count                 "number private person/property target"
	label var relig_targ_count                   "number religious target"
	label var tourist_targ_count                 "number tourist target"
	label var transport_targ_count               "number transport target"
	label var unknown_targ_count                 "number unknown target"
	label var utilities_targ_count               "number utilities target"
	*label var violent_political_party_targ_count "number violent political party target"
	label var NA_targ_count                      "NA target count"
	label var biological_weap_count              "number biological weapon attack"
	label var chemical_weap_count                "number chemical weapon attack"
	label var explosives_weap_count              "number explosive weapon attack"
	label var fake_weap_count                    "number fake weapon attack"
	label var firearms_weap_count                "number firearm attack"
	label var incendiary_weap_count              "number incendiary attack"
	label var melee_weap_count                   "number melee weapon attack"
	label var other_weap_count                   "number other weapon attack"
	label var unknown_weap_count                 "number unknown weapon attack"
	label var vehicle_weap_count                 "number vehicle weapon (not car bomb) attack"
	label var NA_weap_count                      "number NA weapon"
	
	save "senate_all_terror.dta", replace 
	
	clear

**********************************************************************
*****************Clean up county election-year house data*************
**********************************************************************

*Label vars in house data and save as .dta

	use "house_all_terror.dta"
	
	label var state_fips "State FIPS Code"
	label var county_fips "county FIPS Code"
	label var election_year "Year of Election"
	label var fips "total fips code"
	label var totalvote "Total Raw Vote"
	label var dem_rank "rank of dem candidate"
	label var rep_rank "rank of republican candidate"
	label var ind_rank "rank of other candidate"
	label var margin "Raw margin of victory"
	label var perc_margin "Percentage margin of victory"
	label var dem_perc_vote "Percentage vote democrat"
	label var rep_perc_vote "Percentage vote republican"
	label var ind_perc_vote "Percentage vote third party"
	label var other_perc_vote "Percentage vote other"
	label var dem_raw_vote "Raw vote for dem candidate"
	label var rep_raw_vote "Raw vote for rep candidate"
	label var cd "Congressional District (coding issues)"
	label var attack_count "total attacks in this period"
	label var days_till_election_avg             "average days till election of attacks"
	label var days_till_election_last            "days till election of the last attack"
	label var abortion_count                     "number of abortion motive attacks"
	label var hatred_count                       "number of hatred motive attacks"	
	label var political_count                    "number of political motive attacks"
	label var unknown_count                      "number of unknown motive attacks"
	label var success_count                      "number of successful attacks"
	label var vicinity_count                     "number of attacks in the vicinity of the coded city"
	label var assassination_count                "number of assassination type attacks"
	label var armed_count                        "number of armed type attacks"
	label var bomb_count                         "number of bomb type attacks"
	label var hijack_count                       "number of hijacking type attacks"
	label var hostage_count                      "number of hostage type attacks"	
	label var kidnap_count                       "number of kidnapping type attacks"
	label var facility_count                     "number of facility type attacks"
	label var unarmed_count                      "number of unarmed type attacks"
	label var unknown_type_count                 "number of unknown type attacks"
	label var suicide_count                      "number of suicide attacks"
	label var nperps_avg                         "average number of perpetrators"
	label var nperps_tot                         "total number of perpetrators"
	label var claimed_count                      "number of claimed attacks"
	label var nkill_avg                          "average number killed"
	label var nkill_tot                          "total number killed"
	label var nkillter_avg                       "average terrorists killed"
	label var nkillter_tot                       "total terrorists killed"
	label var nwound_avg                         "average number wounded"
	label var nwound_tot                         "total number wounded"
	label var nwoundter_avg                      "average terrorists wounded"	
	label var nwoundter_tot                      "total terrorists wounded"
	label var property_count                     "number property damaged"
	label var propvalue_avg                      "average property damaged"
	label var propvalue_tot                      "total value of property damaged"
	label var international_logistics_count      "number attacks with intl logistics"
	label var abortion_targ_count                "number abortion target"
	label var air_targ_count                     "number air target"
	label var business_targ_count                "number business target"
	label var education_targ_count               "number education target"
	label var diplo_targ_count                   "number gov diplomacy target"
	label var gov_targ_count                     "number general gov target"
	label var media_targ_count                   "number media/journalist target"
	label var maritime_targ_count                "number maritime target"
	label var military_targ_count                "number military target"
	label var ngo_targ_count                     "number ngo target"
	label var police_targ_count                  "number police target"
	label var private_targ_count                 "number private person/property target"
	label var relig_targ_count                   "number religious target"
	label var nonstate_actor_targ_count          "number NSA/terrorist org target"
	label var tourist_targ_count                 "number tourist target"
	label var transport_targ_count               "number transport target"
	label var unknown_targ_count                 "number unknown target"
	label var utilities_targ_count               "number utilities target"
	*label var violent_political_party_targ_count "number violent political party target"
	label var NA_targ_count                      "NA target count"
	label var biological_weap_count              "number biological weapon attack"
	label var chemical_weap_count                "number chemical weapon attack"
	label var explosives_weap_count              "number explosive weapon attack"
	label var fake_weap_count                    "number fake weapon attack"
	label var firearms_weap_count                "number firearm attack"
	label var incendiary_weap_count              "number incendiary attack"
	label var melee_weap_count                   "number melee weapon attack"
	label var other_weap_count                   "number other weapon attack"
	label var sabotage_weap_count                "number sabotage weapon attack"
	label var unknown_weap_count                 "number unknown weapon attack"
	label var vehicle_weap_count                 "number vehicle weapon (not car bomb) attack"
	label var NA_weap_count                      "number NA weapon"
	
	save "house_all_terror.dta", replace 
	
	clear
	
**********************************************************************
*****************Clean up county election-year gub data***************
**********************************************************************

*Label vars in gub data and save as .dta

	import excel "gub_all_terror.xlsx", firstrow
	
    label var fips "fips state and county code of election results - without leading zeros"
	label var election_year "year of election"
	label var incumbent_demo "Incumbent was a Democrat during election"
	label var pct_demo "percentage vote for democrat"
	label var pct_repu "percentage vote for repub"
	label var pct_other "percentage vote for other"
	label var election_date "date of election"
	label var attack_count "total attacks in this period"
	label var days_till_election_avg             "average days till election of attacks"
	label var days_till_election_last            "days till election of the last attack"
	label var abortion_count                     "number of abortion motive attacks"
	label var hatred_count                       "number of hatred motive attacks"	
	label var political_count                    "number of political motive attacks"
	label var unknown_count                      "number of unknown motive attacks"
	label var success_count                      "number of successful attacks"
	label var vicinity_count                     "number of attacks in the vicinity of the coded city"
	label var assassination_count                "number of assassination type attacks"
	label var armed_count                        "number of armed type attacks"
	label var bomb_count                         "number of bomb type attacks"
	label var hijack_count                       "number of hijacking type attacks"
	label var hostage_count                      "number of hostage type attacks"	
	label var kidnap_count                       "number of kidnapping type attacks"
	label var facility_count                     "number of facility type attacks"
	label var unarmed_count                      "number of unarmed type attacks"
	label var unknown_type_count                 "number of unknown type attacks"
	label var suicide_count                      "number of suicide attacks"
	label var nperps_avg                         "average number of perpetrators"
	label var nperps_tot                         "total number of perpetrators"
	label var claimed_count                      "number of claimed attacks"
	label var nkill_avg                          "average number killed"
	label var nkill_tot                          "total number killed"
	label var nkillter_avg                       "average terrorists killed"
	label var nkillter_tot                       "total terrorists killed"
	label var nwound_avg                         "average number wounded"
	label var nwound_tot                         "total number wounded"
	label var nwoundter_avg                      "average terrorists wounded"	
	label var nwoundter_tot                      "total terrorists wounded"
	label var property_count                     "number property damaged"
	label var propvalue_avg                      "average property damaged"
	label var propvalue_tot                      "total value of property damaged"
	label var international_logistics_count      "number attacks with intl logistics"
	label var abortion_targ_count                "number abortion target"
	label var air_targ_count                     "number air target"
	label var business_targ_count                "number business target"
	label var education_targ_count               "number education target"
	label var foodwater_targ_count               "number food/water target"
	label var diplo_targ_count                   "number gov diplomacy target"
	label var gov_targ_count                     "number general gov target"
	label var media_targ_count                   "number media/journalist target"
	label var maritime_targ_count                "number maritime target"
	label var military_targ_count                "number military target"
	label var ngo_targ_count                     "number ngo target"
	label var other_targ_count                   "number other target"
	label var police_targ_count                  "number police target"
	label var private_targ_count                 "number private person/property target"
	label var relig_targ_count                   "number religious target"
	label var telecom_targ_count                 "number telecom target"
	label var nonstate_actor_targ_count          "number NSA/terrorist org target"
	label var tourist_targ_count                 "number tourist target"
	label var transport_targ_count               "number transport target"
	label var unknown_targ_count                 "number unknown target"
	label var utilities_targ_count               "number utilities target"
	*label var violent_political_party_targ_count "number violent political party target"
	label var NA_targ_count                      "NA target count"
	label var biological_weap_count              "number biological weapon attack"
	label var chemical_weap_count                "number chemical weapon attack"
	label var explosives_weap_count              "number explosive weapon attack"
	label var fake_weap_count                    "number fake weapon attack"
	label var firearms_weap_count                "number firearm attack"
	label var incendiary_weap_count              "number incendiary attack"
	label var melee_weap_count                   "number melee weapon attack"
	label var other_weap_count                   "number other weapon attack"
	label var radiological_weap_count            "number radiological weapon attack"
	label var sabotage_weap_count                "number sabotage weapon attack"
	label var unknown_weap_count                 "number unknown weapon attack"
	label var vehicle_weap_count                 "number vehicle weapon (not car bomb) attack"
	label var NA_weap_count                      "number NA weapon"
	
	save "gub_all_terror.dta", replace 
	
	clear
